// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
import {AddRegionInput,DeleteRegionInput,PageRegionInput,UpdateRegionInput } from  '../models';
// 定义 API 路径枚举
enum Api {
    SysRegionAdd = '/sysRegion/add',
    SysRegionDelete = '/sysRegion/delete',
    SysRegionList = '/sysRegion/list',
    SysRegionPage = '/sysRegion/page',
    SysRegionSync = '/sysRegion/sync',
    SysRegionUpdate = '/sysRegion/update',
}

// 定义 API 方法
export const apiSysRegionAddPost = (body?: AddRegionInput) =>
    request({
        url: Api.SysRegionAdd,
        method: 'post',
        data: body,
    });

export const apiSysRegionDeletePost = (body?: DeleteRegionInput) =>
    request({
        url: Api.SysRegionDelete,
        method: 'post',
        data: body,
    });

export const apiSysRegionListGet = (id: number) =>
    request({
        url: `${Api.SysRegionList}?Id=${id}`,
        method: 'get',
    });

export const apiSysRegionPagePost = (body?: PageRegionInput) =>
    request({
        url: Api.SysRegionPage,
        method: 'post',
        data: body,
    });

export const apiSysRegionSyncPost = () =>
    request({
        url: Api.SysRegionSync,
        method: 'post',
    });

export const apiSysRegionUpdatePost = (body?: UpdateRegionInput) =>
    request({
        url: Api.SysRegionUpdate,
        method: 'post',
        data: body,
    });